package com.itc.bpm.util;

import org.quartz.CronExpression;

public class ValidCronUtil {

    public static boolean isValidCronExpression(String exp) {
        if (exp == null || exp.length() ==0) return false;
        boolean validExpression = CronExpression.isValidExpression(exp);
        if (validExpression) System.out.println("cron expression is valid.");
        return validExpression;
    }

    public static void main(String[] args) {
        String cron = "0 26 9 ? * 1,2,3,4,5";
        boolean validCronExpression = isValidCronExpression(cron);
        System.out.println(validCronExpression);
    }
}
